//
//  NFSJSBridgeHelper.h
//  NetEaseFinancial
//
//  Created by 吴玉峰 on 8/17/15.
//  Copyright (c) 2015 吴玉峰. All rights reserved.
//

#import <Foundation/Foundation.h>

// 去除此功能
//static NSString *const PARAM_JS_GO_BACK_RESULT = @"result";
//static NSString *const REQUEST_NATIVE_GO_BACK = @"goBack";
//

// 去除此功能
//// 当页面resume时,通知html5

// API的level 20160518:11:38
static NSString *const API_LEVEL = @"4";

static NSString *const PARAM_JS_ON_RESUME_RESULT = @"result";
static NSString *const REQUEST_NATIVE_RESUME = @"onResume";

// 刷新错误页面
static NSString *const REQUEST_JS_REFRESH_PAGE = @"nfs.error.refreshPage";

static NSString *const REQUEST_JS_GET_NETWORK_TYPE = @"nfs.device.getNetworkType";

// webview title
static NSString *const PARAM_JS_TITLE = @"title";

// 分享标题
static NSString *const PARAM_JS_SHARE_TITLE = @"title";
// 分享描述
static NSString *const PARAM_JS_SHARE_DESC = @"desc";
// 分享链接
static NSString *const PARAM_JS_SHARE_LINK = @"link";
// 分享图标
static NSString *const PARAM_JS_SHARE_IMG_URL = @"imgUrl";

// 分享类型,music、video或link，不填默认为link
static NSString *const PARAM_JS_SHARE_TYPE = @"type";

// 如果type是music或video，则要提供数据链接，默认为空
static NSString *const PARAM_JS_SHARE_DATA_URL = @"dataUrl";

static NSString *const PARAM_JS_SHARE_EXTRA = @"extra";

// 分享来源种类
static NSString *const PARAM_JS_SHARE_SOURCE_TYPE = @"sourceType";

// 分享到微信朋友圈
static NSString *const REQUEST_JS_SHARE_ON_WE_CHAT_MOMENT = @"nfs.share.shareOnWeChatMoment";

// 分享给微信好友
static NSString *const REQUEST_JS_SEND_TO_WE_CHAT_FRIEND = @"nfs.share.sendToWeChatFriend";

// 分享到易信朋友圈
static NSString *const REQUEST_JS_SHARE_ON_EASY_CHAT_MOMENT = @"nfs.share.shareOnEasyChatMoment";

// 分享给易信好友
static NSString *const REQUEST_JS_SEND_TO_EASY_CHAT_FRIEND = @"nfs.share.sendToEasyChatFriend";

// 分享到新浪微博
static NSString *const REQUEST_JS_SHARE_ON_SINA_WEIBO = @"nfs.share.shareOnSinaWeibo";

// 弹出分享面板
static NSString *const REQUEST_JS_SHOW_SHARE_PANEL = @"nfs.share.showSharePanel";

static int VALUE_JS_IS_HEAD_PORTRAIT_TRUE = 1;

// 如果不设置，默认为0(非头像)
static NSString *const PARAM_JS_IMAGE_IS_HEAD_PORTRAIT = @"isHeadPortrait";

// 如果不设置，默认为9
static NSString *const PARAM_JS_IMAGE_MAX_SELECTED_COUNT = @"count";
// 拍照或从手机相册中选图接口
static NSString *const REQUEST_JS_CHOOSE_IMAGE = @"nfs.image.chooseImage";

// 预览图片接口
static NSString *const REQUEST_JS_PREVIEW_IMAGE = @"nfs.image.previewImage";

// 上传图片接口
static NSString *const REQUEST_JS_UPLOAD_IIMAGE = @"nfs.image.uploadImage";

// 下载图片接口
static NSString *const REQUEST_JS_DOWNLOAD_IIMAGE = @"nfs.image.downloadImage";

// 获取地理位置接口
static NSString *const REQUEST_JS_GET_LOCATION = @"nfs.location.getLocation";

// 查看位置接口
static NSString *const REQUEST_JS_OPEN_LOCATION = @"nfs.location.openLocation";

// 显示右上角菜单接口
static NSString *const REQUEST_JS_SHOW_OPTION_MENU = @"nfs.menu.showOptionMenu";

// 隐藏右上角菜单接口
static NSString *const REQUEST_JS_HIDE_OPTION_MENU = @"nfs.menu.hideOptionMenu";

// 自定义分享内容接口
static NSString *const REQUEST_JS_ON_MENU_SHARE = @"nfs.menu.onMenuShare";

// 别名
static NSString *const PARAM_JS_PUSH_ALIAS = @"alias";

// tag数组
static NSString *const PARAM_JS_PUSH_TAGS = @"tags";

// 设置Jpush alias 和 tags 接口
static NSString *const REQUEST_JS_SET_ALIAS_AND_TAGS = @"nfs.push.setAliasAndTags";

// 恢复推送服务
static NSString *const REQUEST_JS_RESUME_PUSH = @"nfs.push.resumePush";

// 停止推送服务
static NSString *const REQUEST_JS_STOP_PUSH = @"nfs.push.stopPush";

static NSString *const PARAM_NATIVE_APP_VERSION_NAME = @"versionName";
// 获取版本名称接口
static NSString *const REQUEST_JS_GET_VERSION_NAME = @"nfs.app.getVersionName";

// 版本号 对应的value为整数类型
static NSString *const PARAM_NATIVE_APP_VERSION_CODE = @"versionCode";
// 获取版本号接口
static NSString *const REQUEST_JS_GET_VERSION_CODE = @"nfs.app.getVersionCode";

static NSString *const PARAM_JS_APP_APK_URL = @"apkUrl";

// APPID
static NSString *const PARAM_NATIVE_APP_ID = @"appId";

static NSString *const REQUEST_JS_GET_APP_ID = @"nfs.app.getAppId"; // 获取appId

// APP SECRET
static NSString *const PARAM_NATIVE_APP_SECRET = @"appSecret";

static NSString *const REQUEST_JS_GET_APP_SECRET = @"nfs.app.getAppSecret"; // 获取appSecret

//获取设备UDID
static NSString *const PARAM_JS_DEVICE_ID = @"deviceId";

static NSString *const REQUEST_JS_GET_UNIQUE_DEVICE_ID = @"nfs.device.getUniqueDeviceId"; // 获取appId

// 更新app接口
static NSString *const REQUEST_JS_UPDATE_APP = @"nfs.app.UpdateApp";

static NSString *const PARAM_NATIVE_FORCE_UPDATE = @"forceUpdate";
static NSString *const REQUEST_JS_IS_APP_NEED_FORCE_UPDATE = @"nfs.app.isAppNeedForceUpdate";

// 返回值为true或false
static NSString *const PARAM_TIME_TIMEOUT = @"timeout";
static NSString *const REQUEST_JS_IS_LOGIN_TIME_OUT = @"nfs.time.isLoginTimeout";

// 文件的Url
static NSString *const PARAM_JS_FILE_URL = @"fileUrl";
static NSString *const REQUEST_JS_PREVIEW_ONLINE_FILE = @"nfs.file.previewOnlineFile";

// 未读消息数
static NSString *const PARAM_JS_ACCOUNT_UNREAD_MESSAGE_COUNT = @"count";
static NSString *const REQUEST_JS_SET_UNREAD_PRIVATE_MESSAGE_COUNT = @"nfs.account.setUnreadPrivateMessageCount";

// 清除缓存
static NSString *const REQUEST_JS_CLEAR_WEB_CACHE = @"nfs.webCache.clearCache";

static NSString *const PARAM_JS_LOCK_PATTERN_USER_ID = @"userId";
static NSString *const PARAM_NATIVE_LOCK_PATTERN_EXISTS = @"isExists";
static NSString *const PARAM_JS_LOCK_PATTERN_HEAD_PORTRAIT_URL = @"headPortraitUrl";
static NSString *const PARAM_JS_LOCK_PATTERN_CLIENT_ID = @"clientId";
static NSString *const PARAM_NATIVE_API_LEVEL = @"apiLevel";
static NSString *const REQUEST_JS_SHOW_LOCK_PATTERN_CREATE_SCREEN = @"nfs.showLockPatternCreateScreen";
static NSString *const REQUEST_JS_IS_LOCK_PATTERN_EXISTS = @"nfs.isLockPatternExists";
static NSString *const REQUEST_JS_SHOW_LOCK_PATTERN_RESET_SCREEN = @"nfs.showLockPatternResetScreen";
static NSString *const REQUEST_JS_GET_FORTUNE_CLUB_API_LEVEL = @"nfs.getFortuneClubApiLevel";

static NSString *const REQUEST_JS_SET_TITLE = @"nfs.setTitle";

@class WYFWebViewProxyDelegate;

@interface NFSJSBridgeHelper : NSObject

- (instancetype)initWithWebViewProxyDelegate:(WYFWebViewProxyDelegate *)webViewProxyDelegate;

- (void)registerCommands;

- (void)addWebViewActionListener:(NSString *)actionName listener:(id)listener;

- (void)executeJsFunctionWithCmdName:(NSString *)cmdName params:(NSDictionary *)params jsCallback:(id)jsCallback;

@end
